import vue from '@vitejs/plugin-vue'
import { resolve } from 'path'
// elementplus 按需引入
// import AutoImport from 'unplugin-auto-import/vite'
// import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
// import Components from 'unplugin-vue-components/vite'
import { defineConfig } from 'vite'

// https://vitejs.dev/config/
export default defineConfig({
  base: './',
  plugins: [
    vue(),
    // AutoImport({
    //   resolvers: [ElementPlusResolver()],
    // }),
    // Components({
    //   resolvers: [ElementPlusResolver()],
    // }),
  ],
  resolve:{
    alias:{
      '@':resolve(__dirname,'src')
    }
  },
  css:{
    preprocessorOptions: {
      scss: {
         additionalData: ['@import "./src/style/base.scss";'], // 全局公共样式
         charset:false
      }
   }
  },
  define: {
    'process.env': process.env
  }
})
